package com.kang.c0c.tree.node;

/**
 * 一个用于定义语法分析时产生的抽象语法树的节点类型的接口 
 * 分别定义了各种不同节点类型的整数值，是类com.kang.c0c.tree.Node中字段node的具体内容的含义的抽象化
 * 
 * @author kang
 *
 * Feb 6, 2009
 */
public interface Nodes {
	public static final int FUNCTION = 0;
	public static final int BLOCK = FUNCTION + 1;
	public static final int SBLOCK = BLOCK + 1;
	
	//算术运算符
	public static final int PLU = SBLOCK + 1;
	public static final int SUB = PLU + 1;
	public static final int MUL = SUB + 1;
	public static final int DIV = MUL + 1;
	
	//赋值
	public static final int EVA = DIV + 1;
	
	//关系运算符
	public static final int EQU = EVA + 1;
	public static final int GT = EQU + 1;
	public static final int LT = GT + 1;
	public static final int GEQ = LT + 1;
	public static final int LEQ = GEQ + 1;
	public static final int NEQ = LEQ + 1;
	
	//if,while,scanf,printf,return
	public static final int IF = NEQ + 1;
	public static final int WHILE = IF + 1;
	public static final int SCAN = WHILE + 1;
	public static final int PRINT = SCAN + 1;
	public static final int RETURN = PRINT + 1;
	
	//函数调用及其参数列表
	public static final int CALL = RETURN + 1;
	public static final int PARAM = CALL + 1;
	
	public static final int UNARY = PARAM + 1;
	
	//叶节点类型，变量或者是字符串
	public static final int VAR = UNARY + 1;
	public static final int STRING = VAR + 1;
	public static final int NUM = STRING + 1;
	
	//接口内定义的节点类型的总数
	public static final int NodesCount = NUM + 1;
}
